package guestbook;

import java.util.List;

import javax.jdo.PersistenceManager;

public class MessageList {

	@SuppressWarnings( "unchecked" )
	public List<Message> getMessages() {
		PersistenceManager pm = PMF.get().getPersistenceManager();
		String query = "SELECT FROM " + Message.class.getName() + " order by messageDate desc";
		
		return ((List<Message>)pm.newQuery( query ).execute());
	}
	
}